package com.song.web;

import com.song.service.impl.GradeServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/Educational/student/addStudent")
public class GradeServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取数据
        //调用service
        GradeServiceImpl gradeService = new GradeServiceImpl();
        List grade = gradeService.getGrade();

        req.setAttribute("gradelist", grade);
        req.getRequestDispatcher("edit.jsp").forward(req, resp);

    }
}
